//
//  ContentView.swift
//  firstiPhoneApp
//
//  Created by liy on 2025/1/19.
//

import SwiftUI

func mySelect() -> String {
  let fruitEmojis: [String] = ["🍎", "🍏", "🍐", "🍊", "🍋", "🍌", "🍉", "🍇", "🍈", "🍍", "🥭", "🍑", "🍒", "🍓", "🫐", "🫒", "🥝", "🍅", "🥥", "🥑"]
	return fruitEmojis.randomElement()!
}

struct ContentView: View {
	@State private var today = mySelect()
  var body: some View {
    VStack {
      Spacer()
			Text("\(today)")
        .font(.system(size: 100)) // css
        .padding()
      Spacer()

      Button("今天吃啥？") {
        // 脚本
				today = mySelect()
      }
      .padding()
      .background(.teal)
      .foregroundColor(.white) // .foregroundStyle(.white)
      .cornerRadius(40) //			.clipShape(.capsule)
      Spacer()
    }
    .padding()
  }
}

#Preview {
  ContentView()
}
